<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script src="spellcheck_test.js"></script>

<script>
test(() => assert_false(navigator.platform.includes('Mac')),
    'This test requires context menu key.');
test(() => assert_not_equals(window.eventSender, undefined),
    'This test requires event sender.');

spellcheck_test(
    '<div contenteditable>well|come home.</div>',
    '',
    '<div contenteditable>#wellcome# home.</div>',
    {
      title: 'Mark initial misspelling.',
      callback: sample => test(() => {
        eventSender.keyDown('ContextMenu');
        eventSender.keyDown('Escape');
        assert_equals(sample.selection.toString(), 'wellcome');
      }, 'When caret is on a misspelled word, pressing context menu key ' +
      'selects the word.')
    });
</script>
